home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _2384736DCDF94695B49BC799E39C7185 < prev    next >
Encoding:
Text File  |  2004-01-06  |  812 b   |  28 lines

  1. BiPod = {
  2.     IsActive = 0,
  3.     AccuracyWin = 1.5,
  4.     OldMinSway = 0,
  5.     ActivateSnd = Sound:LoadSound("Sounds/Weapons/bipodopen.wav"),
  6.     DeactivateSnd = Sound:LoadSound("Sounds/Weapons/bipodclose.wav"),
  7. }
  8.  
  9. function BiPod:Activate( Active )
  10.     if ( BiPod.IsActive == Active ) then
  11.         return
  12.     end
  13.     System:LogToConsole( Active );
  14.     BiPod.IsActive = Active;
  15.     local player = _localplayer;
  16.     if ( BiPod.IsActive ~= 0 ) then
  17.         BiPod.OldMinSway = player.MinSway;
  18.         player.MinSway = player.MinSway / BiPod.AccuracyWin;
  19.         System:LogToConsole( "BiPod enabled" );
  20.         self:StartAnimation(0, "BiPodO");
  21.         Sound:PlaySound( BiPod.ActivateSnd );
  22.     else
  23.         player.MinSway = BiPod.OldMinSway;
  24.         System:LogToConsole( "BiPod disabled" );
  25.         self:StartAnimation(0, "BiPodC");
  26.         Sound:PlaySound( BiPod.DeactivateSnd );
  27.     end
  28. end